package ynu.edu.stats.properties;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

@Data
@Component
@ConfigurationProperties(prefix = "spring.rabbitmq.stats")
public class RabbitmqStatsProperties {
    private Queue queue = new Queue();
    private Exchange exchange = new Exchange();
    private DlxQueue dlxQueue = new DlxQueue();
    private Retry retry = new Retry();
    private Listener listener = new Listener();

    //  业务路由键
    private String itemRoutingKey;
    private String userGrowthRoutingKey;

    @Data
    public static class Queue {
        private String name;
        private String dlxExchange;
        private String dlxRoutingKey;
    }

    @Data
    public static class Exchange {
        private String name;
    }

    @Data
    public static class DlxQueue {
        private String name;
    }

    @Data
    public static class Retry {
        private int maxAttempts;
    }

    @Data
    public static class Listener {
        private String acknowledgeMode;
    }
}